<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let str = "<span><div><p>";

      // console.log(str.match(/a(bc){0,1}c/g));
      console.log(str.match(/<([a-z]+?)>/g));
      const res = str.matchAll(/<([a-z]+?)>/g);
      console.log([...res]);
    </script>
  </body>
</html>
